"esdk 组件"

__author__ = "zwj"

# 导入根目录作为模块搜索路径
import os, sys

# ([".."] * 4) 就是项目目录里面 4 层
parent_path = os.path.abspath(os.path.join(__file__, *([".."] * 4)))
sys.path.insert(0, parent_path)

from core.utils.logger import logging

# sys.path.append("cs-build/lib")
import dji_esdk

esdk = dji_esdk.Esdk()


if __name__ == "__main__":
    print(esdk)
    print(dir(esdk))
    
    flag = esdk.Init()
    print(flag)

    # esdk_processor.start()
    # time.sleep(30)
    # esdk_processor.close()

    while True:
        user_input = input("请输入 a 执行开启推流,输入 d 执行停止推流:")
        if user_input == "a":
            esdk.StartH264Stream()
        elif user_input == "d":
            esdk.StopH264Stream()
        else:
            print("输入无效，请重新输入。")
